import request from '@/utils/request'

// 线路表列表
export function apiLineLists(params: any) {
    return request.get({ url: '/travel.line/lists', params })
}

// 添加线路表
export function apiLineAdd(params: any) {
    return request.post({ url: '/travel.line/add', params })
}

// 编辑线路表
export function apiLineEdit(params: any) {
    return request.post({ url: '/travel.line/edit', params })
}

// 删除线路表
export function apiLineDelete(params: any) {
    return request.post({ url: '/travel.line/delete', params })
}

// 线路表详情
export function apiLineDetail(params: any) {
    return request.get({ url: '/travel.line/detail', params })
}

export const apiLineApprove = (data: {
    id: number
    status: string
    comment: string
    user_id: number
}) => {
    return request.post({ url: '/travel.line/updateStatus', data })
}

// 导入线路数据
export function importLine(file: File) {
    const formData = new FormData()
    formData.append('file', file)

    return request.post({
        url: '/travel.line/import',
        data: formData,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}

